package com.wcy.feign.perm;

import com.alibaba.csp.sentinel.annotation.SentinelResource;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wcy.entity.SrMenu;
import jakarta.servlet.http.HttpServletRequest;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(name = "cloud-provider-perm",contextId = "FeignMenuService")
public interface FeignMenuService {
    @GetMapping("srMenu/page")
    public ResponseEntity<Page<SrMenu>> getPage(@RequestParam(name = "pageNum",defaultValue = "1") int pageNum,
                                                @RequestParam(name = "pageSize",defaultValue = "10") int pageSize);

    @GetMapping("srMenu/list")
    public ResponseEntity<List<SrMenu>> getList();

    @PostMapping("srMenu/add")
    public ResponseEntity<Void> add(@RequestBody SrMenu srMenu);

    @PutMapping("srMenu/update")
    public ResponseEntity<Void> update(@RequestBody SrMenu srMenu);

    @DeleteMapping("srMenu/delete/{id}")
    public ResponseEntity<Void> delete(@PathVariable("id") Integer id);

    @GetMapping("srMenu/authenticated/list")
    public ResponseEntity<List<SrMenu>> getUserMenuList();
}
